﻿<UserControl x:Class="WPFXMPPClient.AudioPlayerUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Loaded="UserControl_Loaded"
             d:DesignHeight="83" d:DesignWidth="278">
    <Grid Margin="3">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="28" />
            <ColumnDefinition Width="28" />
            <ColumnDefinition Width="28" />
            <ColumnDefinition Width="28" />
            <ColumnDefinition Width="28" />
            <ColumnDefinition Width="80*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="20" />
            <RowDefinition Height="10" />
            <RowDefinition Height="16" />
        </Grid.RowDefinitions>

        <Button Style="{DynamicResource ButtonSurface}" x:Name="ButtonNext" ToolTip="Skip to the next song in the queue" Click="ButtonNext_Click" Grid.Row="0" Grid.Column="1" >
            <Image Source="Images\player - skipforward.png" />
        </Button>

        <Button Style="{DynamicResource ButtonSurface}" ToolTip="Pause" x:Name="ButtonPause" Click="ButtonPause_Click" Grid.Row="0" Visibility="Hidden" Grid.Column="2" >
            <Image Source="Images\player - pause.png" />
        </Button>




        <Button Style="{DynamicResource ButtonSurface}" x:Name="ButtonPlaySong" HorizontalContentAlignment="Center"  VerticalContentAlignment="Center" Click="ButtonPlay_Click">
            <Image>
                <Image.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsSourceActive}" Value="True">
                                <Setter Property="Image.Source" Value="Images/Stop.png" />
                                <Setter Property="Image.ToolTip" Value="Stop playing songs in queue" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding IsSourceActive}" Value="False">
                                <Setter Property="Image.Source" Value="Images/play.png" />
                                <Setter Property="Image.ToolTip" Value="Start playing songs in queue" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
        </Button>

        <Button Style="{DynamicResource ButtonSurface}" x:Name="ButtonQueueSong" Click="ButtonQueueSong_Click" Grid.Row="0" Grid.Column="2" ToolTip="Add song to queue" >
            <Image Source="Images\document - copy.png" />
        </Button>

        <Button Style="{DynamicResource ButtonSurface}" x:Name="ButtonRandom100" Click="ButtonRandom100_Click" Grid.Row="0" Grid.Column="3" ToolTip="Enqueue 100 random songs" >
            <Image Source="Images\file - copy.png" />
        </Button>


        <Button Style="{DynamicResource ButtonSurface}" x:Name="ButtonDeleteQueue" Click="ButtonDeleteQueue_Click" Grid.Row="0" Background="{x:Null}" BorderBrush="{x:Null}" Grid.Column="4" ToolTip="Clear the queue" >
            <Image Source="Images\trash.png" />
        </Button>
        <TextBlock x:Name="TextBlockNowPlaying" Grid.Row="1" Grid.ColumnSpan="6" Text="{Binding Path=CurrentTrackFileOnly}" />
        <TextBlock x:Name="TextBlockNext" Grid.Row="2" FontSize="8" Grid.ColumnSpan="6" Text="{Binding Path=NextTrack}" />

        <Slider x:Name="SliderSongVolume" Grid.Column="6" Orientation="Horizontal" Minimum="0" Maximum="2" Margin="10,0,0,0"
                Value="{Binding Path=SourceAmplitudeMultiplier,Mode=TwoWay}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>

        <CheckBox x:Name="CheckBoxLoop" Grid.Row="3" Grid.ColumnSpan="2" IsChecked="{Binding Path=LoopQueue}" ToolTip="Loop all songs in the queue">Loop</CheckBox>
        <TextBlock x:Name="TextBoxProgress" Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="4"></TextBlock>
    </Grid>
</UserControl>
